package com.yhj.reggie.mapper;

import com.yhj.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {

    //插入入多种口味数据
    Integer save(@Param("dishFlavorList") List<DishFlavor> dishFlavorList);

    //删除口味根据菜品id
    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    Integer delete(Long dishId);

    //根据菜品id获取口味列表
    @Select("select * from dish_flavor where dish_id=#{dishId} and is_deleted=0 ")
    List<DishFlavor> findByDishId(Long dishId);
}
